package com.timesheet.gui.efforttracker.composite;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public class SectionEditCreateNewComposite extends Composite {
	
	private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());

	

	public SectionEditCreateNewComposite(Composite parent, int style) {
		super(parent, style);
		addDisposeListener(new DisposeListener() {

			public void widgetDisposed(DisposeEvent e) {
				toolkit.dispose();
			}
		});
		toolkit.adapt(this);
		toolkit.paintBordersFor(this);
		setLayout(new GridLayout(1, false));
		Section sctnNewEffort = toolkit.createSection(this, Section.TWISTIE | Section.TITLE_BAR);
		sctnNewEffort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		toolkit.paintBordersFor(sctnNewEffort);
		sctnNewEffort.setText("Edit New Effort");
		sctnNewEffort.setExpanded(true);

		EditNewEffortComposite createNewEffortComposite = new EditNewEffortComposite(sctnNewEffort, SWT.NONE);
		toolkit.adapt(createNewEffortComposite);
		toolkit.paintBordersFor(createNewEffortComposite);
		sctnNewEffort.setClient(createNewEffortComposite);
	}

	

}
